//
//  MCAboutVc.swift
//  MCBodyBuildingPro
//
//  Created by Renlvshijie on 2023/5/7.
//

import UIKit
import Toast_Swift

class MCAboutVc: MCBaseVc {

    @IBOutlet weak var copyEmailLabel: UILabel!
    override func viewDidLoad() {
        super.viewDidLoad()
        self.navigationItem.title = "关于Master"
        self.view.backgroundColor = UIColor.qmui_color(withHexString: "#F7F7F9")
        
        let containerTap = UITapGestureRecognizer.init(target: self, action: #selector(containerAction))
        copyEmailLabel.addGestureRecognizer(containerTap)
        
       // loadSubViews()
    }
    
    func loadSubViews() -> Void {
        let iconImageView = UIImageView.init()
        iconImageView.image = UIImage(named: "common_blue_image")
        view.addSubview(iconImageView)
        iconImageView.snp.makeConstraints { make in
            make.centerX.equalTo(view.snp.centerX).offset(0.0)
            make.top.equalTo(view.snp.top).offset(50.0)
            make.width.height.equalTo(90)
        }
        
        let titleLabel = QMUILabel.init()
        titleLabel.text = "Master"
        titleLabel.font = UIFont.systemFont(ofSize: 30)
        titleLabel.textColor = UIColor.qmui_color(withHexString: "#333333")
        view.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { make in
            make.centerX.equalTo(view.snp.centerX).offset(0.0)
            make.top.equalTo(iconImageView.snp.bottom).offset(20)
            
        }
        
        
        let subTitleLabel = QMUILabel.init()
        subTitleLabel.text = "运动健身与健身"
        subTitleLabel.font = UIFont.systemFont(ofSize: 30)
        subTitleLabel.textColor = UIColor.qmui_color(withHexString: "#333333")
        view.addSubview(subTitleLabel)
        subTitleLabel.snp.makeConstraints { make in
            make.centerX.equalTo(view.snp.centerX).offset(0.0)
            make.top.equalTo(titleLabel.snp.bottom).offset(20)
            
        }
        
        
        let versionLabel = QMUILabel.init()
        versionLabel.text = "Version : 1.0.0"
        versionLabel.font = UIFont.systemFont(ofSize: 30)
        versionLabel.textColor = UIColor.qmui_color(withHexString: "#333333")
        view.addSubview(versionLabel)
        versionLabel.snp.makeConstraints { make in
            make.centerX.equalTo(view.snp.centerX).offset(0.0)
            make.top.equalTo(subTitleLabel.snp.bottom).offset(20)
            
        }
        
        
        let contentLabel = QMUILabel.init()
        contentLabel.text = "感谢您注册并使用Master产品，本产品设计的初衷是让更多人去了解运动健身的相关知识。\n\n健康是最大的财富，运动是最好的医生，希望Master产品能够帮助您通过运动健身来让自己更加的健康。\n\nMaster产品连接了ChatGPT，您可以在首页询问您想知道的任何与健身相关的问题。\n\nMaster产品中包含健身计划、动作库和饮食推荐\n\n·您可以参加官方内置的训练计划或设定自己的训练计划。\n\n·动作库将会尽可能的更新目前现有的动作内容，无论是在家训练还是健身房训练，都让您对动作先有充分的了解。\n\n·系统内置了很多健康的饮食菜谱，在您不知道吃什么时可以过来看看。\n\n如果您是运动小白，希望Master能够带您进入运动健身的大门，进入健身房时不再迷茫。\n\n如果您有训练经验或者是资深健身爱好者，您可以将Master当作健身动作“字典”使用。\n\n如果您喜欢Master，但又想提一些建议，请联系我们，我们会仔细考虑您的建议并做出改正。\n\n"
        contentLabel.font = UIFont.systemFont(ofSize: 13)
        contentLabel.numberOfLines = 0
        contentLabel.textColor = UIColor.qmui_color(withHexString: "#333333")
        view.addSubview(contentLabel)
        contentLabel.snp.makeConstraints { make in
            make.left.equalTo(view.snp.left).offset(16)
            make.right.equalTo(view.snp.right).offset(-16)
            make.top.equalTo(versionLabel.snp.bottom).offset(20)
            
        }
        
        let containerView = UIView.init()
        containerView.backgroundColor = UIColor.blue
        view.addSubview(containerView)
        containerView.snp.makeConstraints { make in
            make.centerX.equalTo(view.snp.centerX).offset(0)
            make.top.equalTo(contentLabel.snp.bottom).offset(10)
            make.left.equalTo(view.snp.left).offset(30)
            make.right.equalTo(view.snp.right).offset(-30)
            make.height.equalTo(80)
        }
        
        
        
        
        let addressLabel = QMUILabel.init()
        addressLabel.text = "点击复制邮箱地址"
        addressLabel.font = UIFont.systemFont(ofSize: 30)
        addressLabel.textColor = UIColor.qmui_color(withHexString: "#333333")
        containerView.addSubview(addressLabel)
        addressLabel.snp.makeConstraints { make in
            make.centerX.equalTo(view.snp.centerX).offset(0.0)
            make.top.equalTo(containerView.snp.top).offset(5)
            
        }
        
        let addressEmailLabel = QMUILabel.init()
        addressEmailLabel.text = "health6688999@163.com"
        addressEmailLabel.font = UIFont.systemFont(ofSize: 30)
        addressEmailLabel.textColor = UIColor.qmui_color(withHexString: "#333333")
        containerView.addSubview(addressEmailLabel)
        addressEmailLabel.snp.makeConstraints { make in
            make.centerX.equalTo(view.snp.centerX).offset(0.0)
            make.top.equalTo(addressLabel.snp.bottom).offset(5)
            
        }
        
        
    }
    
    @objc func containerAction() -> Void {
        let pasteBoard = UIPasteboard.general
        pasteBoard.string = "health6688999@163.com"
        self.view.makeToast("复制成功",position: .center)
    }
    
    

}
